<template>
  <div>
    <el-table
    :data="obj"
    stripe
    style="width: 100%">
    <el-table-column 
      prop="id"
      label="编号"
      width="150"
      align="center">
    </el-table-column>
    <el-table-column
      prop="username"
      label="姓名"
      width="150"
      align="center">
    </el-table-column>
    <el-table-column
      prop="telephone"
      label="手机号"
      width="170"
      align="center">
    </el-table-column>
    <el-table-column
      prop="idCard"
      label="身份证号"
      width="170"
      align="center">
    </el-table-column>
    <el-table-column
      prop="bankCard"
      label="银行卡号"
      align="center">
    </el-table-column>
    <el-table-column
      prop="registerTime"
      label="注册时间"
      align="center">
    </el-table-column>
    <el-table-column
      prop="status"
      label="状态"
      align="center">
    </el-table-column>
    <el-table-column
      label="操作"
      align="center">
      <template slot-scope="scope">
        <el-button @click="open(scope.row)" type="text" size="small">审核</el-button>
      </template>
    </el-table-column>
  </el-table>


  <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage1"
      :page-size="pageSize"
      layout="total, prev, pager, next"
      :total="total">
    </el-pagination>
  </div>
</template>

<script>
import qs from 'querystring';

export default {
  data(){
    return{
      obj:[],
      total:0,
      currentPage1:1,
      pageSize:6,
    }
  },
  methods:{
    //详情按钮
    open(row) {
        const h = this.$createElement;
        this.$msgbox({
          title: '审核员工',
          
        });
      },
    //分页查询封装函数
      findAll(){
        var data={
          page:this.currentPage1-1,
          pageSize:this.pageSize
        }
        this.$axios.post("/waiter/query",qs.stringify(data)).then(response=>{
        this.obj=response.data.data.list;
        this.total=response.data.data.total
        // console.log(response.data.data)
    })
      },
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.currentPage1=val;
        this.findAll();
      },
  },
  created(){
    this.findAll();
  }
}
</script>

